package com.wenhuitec.android.tang.util;
import com.sun.jna.Library ;
import com.sun.jna.Native;


public interface CLibrary extends Library {
    //DLL绝对路径的地址获取，注意要去空格，特别坑
    //不同版本的读写器，接口DLL文件名称、函数名称是一样的,但内核代码不一样，请选用与读写器、操作系统一致的OUR_MIFARE.dll
//    String filePath = CLibrary.class.getResource("").getPath().replaceFirst("/","").replaceAll("%20"," ")+"OUR_MIFARE.dll";

//    String filePath = "C:/OUR_MIFARE.dll";



    CLibrary sdtapi = (CLibrary) Native.loadLibrary("CLibrary", CLibrary.class);

    //动态链接库中的方法
    byte pcdbeep(int xms);                         //让设备发出声音
    byte pcdgetdevicenumber(byte[] devicenumber);  //读取设备编号
    byte piccreadex(byte ctrlword,byte[] serial,byte area,byte keyA1B0,byte[] picckey,byte[] piccdata0_2);             //轻松读卡
    byte piccwriteex(byte ctrlword,byte[] serial,byte area,byte keyA1B0,byte[] picckey,byte[] piccdata0_2);            //轻松写卡
    byte piccchangesinglekey(byte ctrlword,byte[] serial,byte area,byte keyA1B0,byte[] piccoldkey,byte[] piccnewkey);  //改单区密码
    byte piccchangesinglekeyex(byte ctrlword,byte[] serial,byte area,byte keyA1B0,byte[] piccoldkey,byte[] piccdata);  //改单区密码，可同时修改A密码，或密码权限访问字(密码权限编码)或B密码
    byte piccrequest(byte[] serial);              //寻卡
    byte piccauthkey1(byte[] serial,byte area,byte keyA1B0,byte[] picckey);    //认证卡片密码
    byte piccread(byte block,byte[] blockdate);   //读指定块信息
    byte piccwrite(byte block,byte[] blockdate);   //写指定块信息
//    byte piccwriteserial(byte ctrlword,byte[] serial,byte keyA1B0,byte[] piccoldkey,byte[] piccdata);  //写UID
}